package P6.T03;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

public class MyMouseListener implements MouseMotionListener, MouseListener {
    private JMyPanel f=null;
    public MyMouseListener(JMyPanel pnl ) {
        f=pnl;
    }

    @Override
    public void mouseDragged(MouseEvent e) {
        f.drawing(e.getX(),e.getY());
    }

    @Override
    public void mouseMoved(MouseEvent e) {

    }

    @Override
    public void mouseClicked(MouseEvent e) {

    }

    @Override
    public void mousePressed(MouseEvent e) {
        f.StartDraw(e.getX(),e.getY());
    }

    @Override
    public void mouseReleased(MouseEvent e) {
        f.drawOver();
    }

    @Override
    public void mouseEntered(MouseEvent e) {

    }

    @Override
    public void mouseExited(MouseEvent e) {

    }
}
